package com.atguigu.dga.meta.controller;

import com.atguigu.dga.meta.bean.TableMetaInfo;
import com.atguigu.dga.meta.service.TableMetaInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 元数据表 前端控制器
 * </p>
 *
 * @author hzh
 * @since 2023-11-15
 */
@RestController
@RequestMapping("/meta/tableMetaInfo")
public class TableMetaInfoController {
    @Autowired
    TableMetaInfoService tableMetaInfoService;

    @PostMapping("/table/{tableName}")
    public void testMeta(@PathVariable("tableName") String tableName){
        TableMetaInfo tableMetaInfo =
                tableMetaInfoService.getTableMetaInfoFromHive("gmall", tableName);
        tableMetaInfoService.addHdfsInfo(tableMetaInfo);

    }
}
